package xmlrpc.client;

import java.net.MalformedURLException;
import java.net.URL;

/**
 * Class for storing information about one server.
 * Immutable.
 * @author Qw4z1
 *
 */

public class ConnectionOptions {
	private final String serverIp;
	private final int serverPort;

	public ConnectionOptions(String serverIp, int serverPort){
		this.serverIp = serverIp;
		this.serverPort = serverPort;
	}
	/**
	 * 
	 * @return	new URL object constructed from serverIp and serverPort
	 * @throws MalformedURLException
	 */
	public URL getConnectionUrl() throws MalformedURLException{
		return new URL("http://"+serverIp+":"+serverPort+"/xmlrpc");
	}
	/**
	 * @return the serverIp
	 */
	public String getServerIp() {
		return serverIp;
	}
	
	/**
	 * @return the serverPort
	 */
	public int getServerPort() {
		return serverPort;
	}
	
	

}
